<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 实例化XMLHttpRequst
        const xhr = XMLHttpRequest
        // 打开路径
        xhr.open("get",'/1' ,true)

        // 发送请求
        xhr.send();
        // 监听事件
        xhr.onreadystatechenge=function(){
            if (xhr.readyState === 4){
                console.log(xhr.responseText);
            }
        }
    </script>
</body>
</html>